package com.webchat.common.service;

import jakarta.annotation.Resource;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

@Component
public class RedisMessageSender {

    @Resource
    private RedisTemplate redisTemplate;

    /**
     * 发布消息
     *
     * @param channel
     * @param message
     */
    public void sendMessage(String channel, String message) {

        redisTemplate.convertAndSend(channel, message);
    }
}
